{eval include template($common_template_pluginid.':new/common/header');}
{if ($_G['cache']['plugin']['aljbdx']['is_aljqb'] && $_G['cache']['plugin']['aljbdx']['adddp_price']) || ($_G['cache']['plugin']['aljbd']['money']&&$_G['cache']['plugin']['aljbd']['money_lx'])}
<div class="weui-cells__title" style="color:red;">{if $_G['cache']['plugin']['aljbdx']['is_aljqb'] && $_G['cache']['plugin']['aljbdx']['adddp_price']}
	{lang aljbd:attent_touch_12}{$_G['cache']['plugin']['aljbdx']['adddp_price']}{$price_symbol}
	{elseif $_G['cache']['plugin']['aljbd']['money']&&$_G['cache']['plugin']['aljbd']['money_lx']}
	{lang aljbd:attent_touch_13}{$_G['cache']['plugin']['aljbd']['money']}{$_G['setting']['extcredits'][$_G['cache']['plugin']['aljbd']['money_lx']]['title']}
	{/if}</div>
<div class="weui-cells weui-cells_form">
{else}
	<div class="weui-cells weui-cells_form" style="margin-top: 0px">
{/if}

	<iframe style="display:none" name="myiframe" id="myiframe"></iframe>
	<form id="postform" name="postform" action="plugin.php?id=aljbd&act={$_GET['act']}" method="POST"  accept-charset="utf-8">
		<input type="hidden" name="formhash" value="{FORMHASH}">
		<input type="hidden" name="bid" value="{$_GET['bid']}">
		<input type="hidden" name="x" value="{$bd['x']}">
		<input type="hidden" name="y" value="{$bd['y']}">
		<input type="hidden" name="region" id="region" value="{$region}">
		<input type="hidden" name="subregion" id="subregion" value="{$subregion}">
		<input type="hidden" name="region1" id="region1" value="{$region1}">
		<input type="hidden" name="type" id="type" value="{$type}">
		<input type="hidden" name="subtype" id="subtype" value="{$subtype}">
		<input type="hidden" name="subtype3" id="subtype3" value="{$subtype3}">
		<input type="hidden" name="aljbd_token" value="{eval echo create_token('aljbd_token');}">
		<div class="weui-cell">
			<div class="weui-cell__hd"><label class="weui-label">{lang aljbd:s230}</label></div>
			<div class="weui-cell__bd">
				<input class="weui-input" type="text" name="name"  value="{$bd['name']}" placeholder="{lang aljbd:attent_touch_1}" >
			</div>
		</div>
		<div class="weui-cell">
			<div class="weui-cell__hd"><label class="weui-label">{lang aljbd:s231}</label></div>
			<div class="weui-cell__bd">
				<input class="weui-input" type="tel" name="tel" value="{$bd['tel']}" placeholder="{lang aljbd:sj_adddp_2}" >
			</div>
		</div>
		<div class="weui-cell">
			<div class="weui-cell__bd">
				<div class="weui-uploader">
					<div class="weui-uploader__hd">
						<p class="weui-uploader__title">{lang aljbd:s232}</p>
						<div class="weui-uploader__info">{lang aljbd:s233}</div>
					</div>
					<div class="weui-uploader__bd">
						<ul class="weui-uploader__files" id="uploaderFiles">
							{if $bd['logo']}

							<li class="weui-uploader__file weui-uploader__file_status img_list" style="background-image:url('{$bd['logo']}')">
								<div class="weui-uploader__file-content">
									<i class="weui-icon-cancel" onclick="delimg(this)"></i>
								</div>
							</li>
							<input name="pic[]" class="pic" type="hidden" value="{$bd['logo']}">

							{/if}
						</ul>
						<div class="weui-uploader__input-box" >
							<input id="uploaderInput" class="weui-uploader__input" type="file"  onchange="lrz_mobile(this,1)">
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="weui-cell weui-cell_access">
			<div class="weui-cell__hd"><label class="weui-label">{lang aljbd:s223}</label></div>
			<div class="weui-cell__bd">
				<input class="weui-input" type="text" id='type-picker' value="{$default_type}"  placeholder="{lang aljbd:s224}"/>
			</div>
			<div class="weui-cell__ft"></div>
		</div>
		<div class="weui-cell weui-cell_access">
			<div class="weui-cell__hd"><label class="weui-label">{lang aljbd:s16}</label></div>
			<div class="weui-cell__bd">
				<input class="weui-input" type="text" id='city-picker' value="{$default}"  placeholder="{lang aljbd:s17}"/>
			</div>
			<div class="weui-cell__ft"></div>
		</div>
		<div class="weui-cell weui-cell_vcode">
			<div class="weui-cell__hd">
				<label class="weui-label">{lang aljbd:s234}</label>
			</div>
			<div class="weui-cell__bd">
				<input class="weui-input" type="text" value="{$bd['addr']}" name="addr" id="addr" placeholder="{lang aljbd:attent_touch_2}">
			</div>
			<div class="weui-cell__ft">
				<button class="weui-vcode-btn" id="geocity" onclick="zxc();return false;">{lang aljbd:attent_touch_3}</button>
			</div>
		</div>
		<div class="weui-cell">
			<div class="weui-cell__hd"><label class="weui-label">qq</label></div>
			<div class="weui-cell__bd">
				<input class="weui-input" type="tel" value="{$bd['qq']}" name="qq" pattern="[0-9]*" placeholder="{lang aljbd:attent_touch_4}">
			</div>
		</div>
		<div class="weui-cell">
			<div class="weui-cell__hd"><label class="weui-label">&#26106;&#26106;&#21495;</label></div>
			<div class="weui-cell__bd">
				<input class="weui-input" type="text" name="wangwang" value="{$bd['wangwang']}" placeholder="{lang aljbd:attent_touch_5}">
			</div>
		</div>
		<div class="weui-cell">
			<div class="weui-cell__hd"><label class="weui-label">&#24494;&#20449;&#21495;</label></div>
			<div class="weui-cell__bd">
				<input class="weui-input" type="text"  placeholder="{lang aljbd:attent_touch_6}" name="weixin_id" value="{$bd['weixin_id']}">
			</div>
		</div>
		{if !$settings['brand_wurl']['value']}
		<div class="weui-cell">
			<div class="weui-cell__hd"><label class="weui-label">{lang aljbd:wurl_1}</label></div>
			<div class="weui-cell__bd">
				<input class="weui-input" type="text"  placeholder="{lang aljbd:wurl_2}" name="wurl" value="{$bd['wurl']}">
			</div>
		</div>
		{/if}
		<div class="weui-cell">
			<div class="weui-cell__hd"><label class="weui-label">{lang aljbd:s244}</label></div>
			<div class="weui-cell__bd">
				<input class="weui-input" type="text"  placeholder="{lang aljbd:attent_touch_7}" name="other" value="{$bd['other']}">
			</div>
		</div>
		<div class="weui-cell weui-cell_access">
			<div class="weui-cell__hd"><label class="weui-label">{lang aljbd:business_hours}</label></div>
			<div class="weui-cell__bd">
				<input class="weui-input" type="text"  placeholder="{lang aljbd:attent_touch_8}" name="business_hours" id="business_hours" value="{$bd['business_hours']}">
			</div>
			<div class="weui-cell__ft"></div>
		</div>
		<div class="weui-cell">
			<div class="weui-cell__hd"><label class="weui-label">{lang aljbd:bus_routes}</label></div>
			<div class="weui-cell__bd">
				<input class="weui-input" type="text"  placeholder="{lang aljbd:attent_touch_9}" name="bus_routes" value="{$bd['bus_routes']}">
			</div>
		</div>
		<div class="weui-cells__title">{lang aljbd:dianping_1}<span class="y"></span></div>
		<div class="weui-cells weui-cells_checkbox" >
			{loop $businesstypearr $k $v}
			<label class="weui-cell weui-check__label" for="s{$k}" >
				<div class="weui-cell__hd">
					<input type="checkbox" class="weui-check" value="$k" onClick="countChoices(this)" name="businesstype[]" id="s{$k}" {if in_array($k,explode(',',$bd['businesstype']))}checked{/if}>
					<i class="weui-icon-checked"></i>
				</div>
				<div class="weui-cell__bd">
					<p>$v</p>
				</div>
			</label>
			{/loop}
			<SCRIPT LANGUAGE="JavaScript">

				function countChoices(obj)
				{
					var inputs = document.getElementsByName("businesstype[]");

					var checked_counts = 0;

					for(var i=0;i<inputs.length;i++){
						if(inputs[i].checked){
							checked_counts++;
						}
					}
					max = 3;
					if (checked_counts > max) {
						alert("{lang aljbd:dianping_3}" + max + "{lang aljbd:dianping_4}");
						obj.checked = false;
						return false;
					}
				}
			</script>
		</div>
		<div class="weui-cells weui-cells_form">
			<div class="weui-cell">
				<div class="weui-cell__bd">
					<textarea class="weui-textarea" name="intro" placeholder="{lang aljbd:sj_adddp_3}" rows="3">{$bd['intro']}</textarea>
				</div>
			</div>
		</div>
		{if $settings['is_agreement']['value']==1}
		<div  class="weui-agree">
			<input id="weuiAgree" type="checkbox" name="agreement" value=1 class="weui-agree__checkbox" readonly checked="checked">
			<label class="weui-agree__text" for="weuiAgree">
				{lang aljbd:attent_touch_10}
			  </label>
			{eval echo htmlspecialchars_decode($settings['agreement']['value'])}
		</div>
		{/if}
		<div class="weui-btn-area">
			<button class="weui-btn weui-btn_primary" name="submit" type="submit" value="Y" onclick="$.showLoading();">{lang aljbd:sj_dianping_12}</button>
		</div>
	</form>
</div>
<script>
    +function($){
        $.rawCitiesData = $cityjson;
        $.rawtypeData = $typejson;
    }($);
    $("#business_hours").picker({
        title: "{lang aljbd:attent_touch_8}",
        value:['8:00', '21:00'],
        formatValue: function (p, values, displayValues) {
            return values[0]+'-'+values[1];
        },
        cols: [
            {textAlign: 'center',values: ["0:00","0:30","1:00","1:30","2:00","2:30","3:00","3:30","4:00","4:30","5:00","5:30","6:00","6:30","7:00","7:30","8:00","8:30","9:00","9:30","10:00","10:30","11:00","11:30","12:00","12:30","13:00","13:30","14:00","14:30","15:00","15:30","16:00","16:30","17:00","17:30","18:00","18:30","19:00","19:30","20:00","20:30","21:00","21:30","22:00","22:30","23:00","23:30"]},
            {divider: true, content: '-'},
            {textAlign: 'center',values: ["0:00","0:30","1:00","1:30","2:00","2:30","3:00","3:30","4:00","4:30","5:00","5:30","6:00","6:30","7:00","7:30","8:00","8:30","9:00","9:30","10:00","10:30","11:00","11:30","12:00","12:30","13:00","13:30","14:00","14:30","15:00","15:30","16:00","16:30","17:00","17:30","18:00","18:30","19:00","19:30","20:00","20:30","21:00","21:30","22:00","22:30","23:00","23:30"]}
        ]
    });
</script>
<script src="{$common_path}/static/weui/js/city-picker.min.js" charset="utf-8"></script>
<script>
    $("#city-picker").cityPicker({
        title: "{lang aljbd:s115}",
        onChange: function (picker, values, displayValues) {
            console.log(values);
            $('#region').val(values[0]);
            $('#subregion').val(values[1]);
            if(values[1] == values[2]){
                $('#region1').val('');
            }else{
                $('#region1').val(values[2]);
            }
        }
    });

</script>
<script src="{$common_path}/static/weui/js/type-picker.min.js" charset="utf-8"></script>
<script>
    $("#type-picker").cityPicker({
        title: "{lang aljbd:attent_touch_11}",
        onChange: function (picker, values, displayValues) {
            console.log(values);
            $('#type').val(values[0]);
            $('#subtype').val(values[1]);
            if(values[1] == values[2]){
                $('#subtype3').val('');
            }else{
                $('#subtype3').val(values[2]);
            }
        }
    });

</script>
{eval include template($common_template_pluginid.':new/common/footer');}
{eval include template($common_template_pluginid.':new/map/post_map');}
